//
//  NXMMineViewController.swift
//  AnneKit-Swift
//
//  Created by 宁小陌 on 2021/2/3.
//  Copyright © 2021 宁小陌. All rights reserved.
//

import UIKit

class NXMMineViewController: UIViewController {
    
    lazy var dateView: XMCountdownView = {
        let dateView = XMCountdownView()
        dateView.endTime = 1614683392
        return dateView
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        NXMUILog(parameter: kStatusBarHeight)
        self.view.backgroundColor = UIColor.kViewColorNormal
        if isIphoneX() {
            NXMUILog(parameter: "isIphoneX")
        }else{
            NXMUILog(parameter: "isIphoneX个锤子")
        }
        let label = UILabel(frame:CGRect(x:30,y:100,width:200,height:40))
        label.backgroundColor = UIColor.cyan;
        label.text = "我的 "
        label.textColor = UIColor.red
        label.font = UIFont.kFontSizeMedium14
        
        label.textAlignment = .center
        label.numberOfLines = 0
//        label.shadowColor = UIColor.gray
//
//        label.shadowOffset = CGSize(width:1.5,height:1.5)
        self.view.addSubview(label)
        
        view.addSubview(dateView)
        
        dateView.frame = CGRect(x: 100, y: 200, width: 170, height: 40)
        
        NXMUILog(parameter: "wode")
        label.nxm_addTapGesture { (UITapGestureRecognizer) in
            XMAppStore.init().nxm_toAppStoreUpdate("1528855437")
        }
        
        NXMUILog(parameter: UIDevice.topSafeAreaHeight)
        NXMUILog(parameter: UIDevice.bottomSafeAreaHeight)
        NXMUILog(parameter: UIDevice.navigationBarHeight)
        NXMUILog(parameter: UIDevice.tabBarHeight)
        
        
        
//        [NXMMineViewController.swift > viewDidLoad() > line:22] - :44.0
//        [NXMMineViewController.swift > viewDidLoad() > line:25] - :isIphoneX
//        [NXMMineViewController.swift > viewDidLoad() > line:46] - :wode
//        [NXMMineViewController.swift > viewDidLoad() > line:51] - :44.0
//        [NXMMineViewController.swift > viewDidLoad() > line:52] - :34.0
//        [NXMMineViewController.swift > viewDidLoad() > line:53] - :88.0
//        [NXMMineViewController.swift > viewDidLoad() > line:54] - :83.0
//
//
//        [NXMMineViewController.swift > viewDidLoad() > line:22] - :47.0
//        [NXMMineViewController.swift > viewDidLoad() > line:25] - :isIphoneX
//        [NXMMineViewController.swift > viewDidLoad() > line:46] - :wode
//        [NXMMineViewController.swift > viewDidLoad() > line:51] - :47.0
//        [NXMMineViewController.swift > viewDidLoad() > line:52] - :34.0
//        [NXMMineViewController.swift > viewDidLoad() > line:53] - :91.0
//        [NXMMineViewController.swift > viewDidLoad() > line:54] - :83.0
        
        
//        [NXMMineViewController.swift > viewDidLoad() > line:22] - :20.0
//        [NXMMineViewController.swift > viewDidLoad() > line:27] - :isIphoneX个锤子
//        [NXMMineViewController.swift > viewDidLoad() > line:46] - :wode
//        [NXMMineViewController.swift > viewDidLoad() > line:51] - :20.0
//        [NXMMineViewController.swift > viewDidLoad() > line:52] - :0.0
//        [NXMMineViewController.swift > viewDidLoad() > line:53] - :64.0
//        [NXMMineViewController.swift > viewDidLoad() > line:54] - :49.0
    }
    
    func currentTimeStamp() -> TimeInterval {
      let date = Date()
      // GMT时间转时间戳 没有时差，直接是系统当前时间戳
      return date.timeIntervalSince1970
    }
    
    func timeStampToString(_ timeStamp: TimeInterval) -> String {
        let date = NSDate(timeIntervalSince1970: timeStamp)
        let dateformatter = DateFormatter()
        dateformatter.dateFormat = "YYYY-MM-dd HH:mm:ss"// 自定义时间格式
        return dateformatter.string(from: date as Date)
    }
}

